package com.yungu.swift.report.controller;

import com.yungu.swift.base.ResponseData;
import com.yungu.swift.base.model.admin.AdminReportParam;
import com.yungu.swift.report.entity.ReportOrderTotalDay;
import com.yungu.swift.report.service.OrderTotalDayService;
import com.yungu.swift.utils.MapUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 订单总量控制器
 */
@RestController
@Api(value = "【订单总量统计】", tags = "订单总量统计")
public class OrderTotalDayCtrl {
    @Autowired
    private OrderTotalDayService orderTotalDayService;

    @PostMapping("/report/orderTotalDay/queryIndex")
    @ApiOperation(value = "首页统计——今日订单", httpMethod = "POST")
    public ResponseData<List<ReportOrderTotalDay>> queryIndex(@RequestBody AdminReportParam reportParam) {
        return orderTotalDayService.queryIndex(reportParam);
    }

    @PostMapping("/report/orderTotalDay/queryTotalInfo")
    @ApiOperation(value = "查询一段时间内的总量", httpMethod = "POST")
    public ResponseData<ReportOrderTotalDay> getTotalInfo(@RequestBody AdminReportParam reportParam) {
        return orderTotalDayService.getTotalInfo(reportParam);
    }
}
